import { ref, watch } from 'vue'

export default function useTitle(titleValue) {
	// document.title = title

	// 定义ref引用数据
	const title = ref(titleValue)

	watch(
		title,
		(newVal, oldVal) => {
			document.title = newVal
		},
		{
			immediate: true,
		}
	)

	return title
}
